package de.preisrobot.business.parser.mindfactory;

public class MindfactoryPager
{
  
 
   
   /**
    * imput String : http://www.mindfactory.de/Notebook+~+PC/Notebooks.html/page/1"
    * 
    * @return ttp://www.mindfactory.de/Notebook+~+PC/Notebooks.html/page/2"
    */
   public String getNextPage(String url)
   {
      String page = "page";
      
      int indexOf = url.indexOf("page");
      if(indexOf <=0)
         return null;
      
      String urlNeu = url.substring(0,indexOf);
      
    
      
      // http://www.mindfactory.de/Notebook+~+PC/Notebooks.html/page/ #split here # 1
      String pageCount = url.substring(indexOf +page.length() + 1, url.length());
      int parseInt = Integer.parseInt(pageCount);
      parseInt ++;
      
      
      String nextPage = urlNeu + page+ "/"+parseInt;
      
      return nextPage;
      
   }
   
}
